home *** CD-ROM | disk | FTP | other *** search
/ The City / the City by ABC - Promo CD.iso / pc / printer.dir / 00005_Field_text.txt
Text File  |  1995-10-27  |  6KB  |  229 lines

  1. on startMovie
  2.   global printer,gPropFont,gMonoFont, gPageCount
  3.   
  4.   if the machineType = 256 then
  5.     --we're running in windows!
  6.     put "times" into gPropFont
  7.     put "times" into gMonoFont
  8.     if not objectP(printer) then
  9.       openxlib "pmatic.dll"
  10.       put pmatic(mNew) into printer
  11.     end if
  12.     if not objectP(printer) then
  13.       Alert "There is no currently selected printer. Printing features will be disabled."┬¼
  14. &return&return&"Error code = "&string(printer) 
  15.     end if
  16.     printTestMIAWWindows gPageCount
  17.   else
  18.     put "times" into gPropFont
  19.     put "times" into gMonoFont
  20.     if not objectP(printer) then
  21.       openxlib "PrintOMatic XObj"
  22.       put PrintOMatic(mNew) into printer
  23.     end if
  24.     if not objectP(printer) then
  25.       Alert "There is no currently selected printer. Printing features will be disabled."┬¼
  26. &return&return&"Error code = "&string(printer) 
  27.     end if
  28.     printTestMIAW
  29.   end if
  30.  
  31. end startMovie
  32.  
  33. on CloseWindow
  34.   stopMovie
  35.   --  tell the stage to cleanupMIAW
  36. end
  37.  
  38. on stopMovie
  39.   global printer
  40.   
  41.   if objectp(printer) then printer(mDispose)
  42.   
  43.   if the machineType = 256 then
  44.     closexlib "pmatic.dll"
  45.   else
  46.     closexlib "printomatic xobj"
  47.   end if
  48. end stopMovie
  49.  
  50. on printTestMIAW pageCount
  51.   global printer,gPrintList
  52.   if not objectP(printer) then
  53.     Alert "There is no currently selected printer. Printing features are disabled."
  54.   else
  55.     cursor 4
  56.     printer (mReset)
  57.     
  58.     put printer(mGetPageWidth) into w
  59.     put printer(mGetPageHeight) into h
  60.     
  61.     printer (mmasterTextBox,0,0,w,h)
  62.     printer (mNewPage)
  63.     FormatText (gPrintList)
  64.     printer (mPrint)
  65.     cursor -1
  66.   end if
  67.   
  68.   closeWindow
  69. end 
  70.  
  71.  
  72. on printTestMIAWWindows pageCount
  73.   global printer,gPrintList
  74.   if not objectP(printer) then
  75.     Alert "There is no currently selected printer. Printing features are disabled."
  76.   else
  77.     cursor 4
  78.     
  79.     printer (mReset)
  80.     
  81.     put printer(mGetPageWidth) into w
  82.     put printer(mGetPageHeight) into h
  83.     repeat with x = 1 to pageCount
  84.       printer (mNewPage)
  85.       printer (mTextBox,0,0,w,h,true)
  86.     end repeat
  87.     FormatText (gPrintList)
  88.     printer (mPrint)
  89.     
  90.     cursor -1
  91.     
  92.   end if
  93.   
  94.   closeWindow
  95. end 
  96.  
  97.  
  98. on FormatText txt
  99.   global printer,gPropFont
  100.   printer (mSetTextFont,gPropFont)
  101.   printer (mSetTextStyle,"bold")
  102.   printer (mSetTextSize,14)
  103.   printer (mAppendText,line 1 of txt&return)
  104.   printer (mSetTextStyle,"normal")
  105.   printer (mAppendText,line 2 of txt&return&return)
  106.   
  107.   repeat with cnt = 3 to the number of lines in txt
  108.     printer (mSetTextSize,12)
  109.     printer (mAppendText,line cnt of txt)
  110.     printer (mSetTextSize,12)
  111.     printer (mAppendText," "&return )
  112.   end repeat
  113.   
  114. end
  115.  
  116. new lineson startMovie
  117.   global printer,gPropFont,gMonoFont, gPageCount
  118.   
  119.   if the machineType = 256 then
  120.     --we're running in windows!
  121.     put "times" into gPropFont
  122.     put "times" into gMonoFont
  123.     if not objectP(printer) then
  124.       openxlib "pmatic.dll"
  125.       put pmatic(mNew) into printer
  126.     end if
  127.     if not objectP(printer) then
  128.       Alert "There is no currently selected printer. Printing features will be disabled."┬¼
  129. &return&return&"Error code = "&string(printer) 
  130.     end if
  131.     printTestMIAWWindows gPageCount
  132.   else
  133.     put "times" into gPropFont
  134.     put "times" into gMonoFont
  135.     if not objectP(printer) then
  136.       openxlib "PrintOMatic XObj"
  137.       put PrintOMatic(mNew) into printer
  138.     end if
  139.     if not objectP(printer) then
  140.       Alert "There is no currently selected printer. Printing features will be disabled."┬¼
  141. &return&return&"Error code = "&string(printer) 
  142.     end if
  143.     printTestMIAW
  144.   end if
  145.  
  146. end startMovie
  147.  
  148. on CloseWindow
  149.   stopMovie
  150.   --  tell the stage to cleanupMIAW
  151. end
  152.  
  153. on stopMovie
  154.   global printer
  155.   
  156.   if objectp(printer) then printer(mDispose)
  157.   
  158.   if the machineType = 256 then
  159.     closexlib "pmatic.dll"
  160.   else
  161.     closexlib "printomatic xobj"
  162.   end if
  163. end stopMovie
  164.  
  165. on printTestMIAW pageCount
  166.   global printer,gPrintList
  167.   if not objectP(printer) then
  168.     Alert "There is no currently selected printer. Printing features are disabled."
  169.   else
  170.     cursor 4
  171.     printer (mReset)
  172.     
  173.     put printer(mGetPageWidth) into w
  174.     put printer(mGetPageHeight) into h
  175.     
  176.     printer (mmasterTextBox,0,0,w,h)
  177.     printer (mNewPage)
  178.     FormatText (gPrintList)
  179.     printer (mPrint)
  180.     cursor -1
  181.   end if
  182.   
  183.   closeWindow
  184. end 
  185.  
  186.  
  187. on printTestMIAWWindows pageCount
  188.   global printer,gPrintList
  189.   if not objectP(printer) then
  190.     Alert "There is no currently selected printer. Printing features are disabled."
  191.   else
  192.     cursor 4
  193.     
  194.     printer (mReset)
  195.     
  196.     put printer(mGetPageWidth) into w
  197.     put printer(mGetPageHeight) into h
  198.     repeat with x = 1 to pageCount
  199.       printer (mNewPage)
  200.       printer (mTextBox,0,0,w,h,true)
  201.     end repeat
  202.     FormatText (gPrintList)
  203.     printer (mPrint)
  204.     
  205.     cursor -1
  206.     
  207.   end if
  208.   
  209.   closeWindow
  210. end 
  211.  
  212.  
  213. on FormatText txt
  214.   global printer,gPropFont
  215.   printer (mSetTextFont,gPropFont)
  216.   printer (mSetTextStyle,"bold")
  217.   printer (mSetTextSize,14)
  218.   printer (mAppendText,line 1 of txt&return)
  219.   printer (mSetTextStyle,"normal")
  220.   printer (mAppendText,line 2 of txt&return&return)
  221.   
  222.   repeat with cnt = 3 to the number of lines in txt
  223.     printer (mSetTextSize,12)
  224.     printer (mAppendText,line cnt of txt)
  225.     printer (mSetTextSize,12)
  226.     printer (mAppendText," "&return )
  227.   end repeat
  228.   
  229. end